<template>
  <div id="app">
    <div id="msg-box" :class="{'show':alertState}" v-text="alertMsg"></div>
    <toolbar v-show="maxEditor" class="no-select"></toolbar>
    <note-list v-show="maxEditor"></note-list>
    <note-editor></note-editor>
  </div>
</template>
<script>
  import toolbar from './components/toolbar.vue';
  import noteList from './components/note-list.vue';
  import noteEditor from './components/note-editor.vue';
  export default {
    components:{
      toolbar,
      noteList,
      noteEditor
    },
    vuex:{
      getters:{
        alertState:(state) => state.alertState,
        alertMsg:(state) => state.alertMsg,
        maxEditor:(state) => state.maxEditor,
      }
    }
  };
</script>

<style>
  html,body,div,span,a,img,i,ul,li,h4,p,input,textarea{
    margin:0;
    padding:0;
  }
  html,body{
    width:100%;
    height:100%;
    box-sizing:border-box;
    font-size:16px;
    font-family:"微软雅黑";
    line-height:1.65;
    color:#555;
  }
  img{
    max-width:100%;
  }
  input,textarea{
    outline:none;
    font-family:"微软雅黑";
  }
  /*滚动条*/
  ::-webkit-scrollbar{
  	width:5px;
  }
  ::-webkit-scrollbar-button:vertical,
  ::-webkit-scrollbar-track:vertical{
  	display:none;
  }
  ::-webkit-scrollbar-track:vertical{display:none;}
  ::-webkit-scrollbar-thumb:vertical{
  	background-color:#7bcef4;
  }
  ul,li{
    list-style:none;
  }
  body{
    background:url("./assets/images/background.jpg") no-repeat;
    background-size:cover;
  }
  a{
    text-decoration:none;
    color:#555;
  }
  a:hover{
    color:#19B5FE;
  }
  #app{
    position:absolute;
    top:20px;
    left:20px;
    right:20px;
    bottom:20px;
    background:#fff;
    box-sizing:border-box;
    display:-webkit-box;
    display:-moz-box;
    display:box;
    box-orient:horizontal;
    -webkit-box-orient:horizontal;
    -moz-box-orient:horizontal;
    border-radius:4px;
    overflow:hidden;
  }
  /*禁止选择*/
  .no-select{
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
  }
  #msg-box{
    width:100%;
    height:40px;
    text-align:center;
    line-height:40px;
    color:#fff;
    font-size:14px;
    background:#398dee;
    position:absolute;
    top:0;
    left:0;
    z-index:20;
    opacity:0;
    -moz-transform:translateY(-100%);
    -ms-transform:translateY(-100%);
    transform:translateY(-100%);
    -moz-transition:transform 0.15s , opacity 0.15s;
    -ms-transition:transform 0.15s , opacity 0.15s;
    transition:transform 0.15s , opacity 0.15s;
  }
  #msg-box.show{
    opacity:1;
    -moz-transform:translateY(0);
    -ms-transform:translateY(0);
    transform:translateY(0);
  }
  /*分类*/
  .show-select{
    position:absolute;
    width:120px;
    background:#fff;
    -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    box-sizing:border-box;
    z-index:5;
    border-radius:2px;
  }
  .show-select::after{
    content: "";
    height: 10px;
    width: 10px;
    -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    background-color:#fff;
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform:rotate(-45deg);
    border-left:0;
    border-bottom:0;
    position: absolute;
    top:-5px;
    left:50%;
    margin-left:-5px;
  }
  .show-select > span{
    display:block;
    background:#fff;
    position:relative;
    z-index:15;
    width:100%;
    line-height:40px;
    cursor:pointer;
    font-size:14px;
    text-align:center;
  }
  .down-select > span:hover,
  .show-select > span:hover{
    background:#f4f9ff;
    color:#19B5FE!important;
  }

  /*添加选项动画*/
  .add-transition {
    opacity:1;
    transition:transform .3s ease , opacity .3s ease;
    transform:translate3d(0,0,0);
    -webkit-transform:translate3d(0,0,0);
    -moz-transform:translate3d(0,0,0);
  }
  .add-enter, .add-leave{
    opacity: 0;
    transform:translate3d(0,-20px,0);
    -webkit-transform:translate3d(0,-20px,0);
    -moz-transform:translate3d(0,-20px,0);
  }
</style>
